// import './assets/main.css'
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'
import './permission'
import '@/style/index.scss'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'//pinia持久化插件
import allGlobalComponent from '@/components'
import {getHeaders,fileUpload} from "@/util";


const app = createApp(App)
const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)//使用持久化插件
app.config.globalProperties.$getHeaders=getHeaders()
app.config.globalProperties.$fileUpload=fileUpload
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
app.use(pinia)
app.use(router)
app.use(ElementPlus)
app.use(allGlobalComponent)
// app.config.errorHandler=(err)=>{
//     console.log("全局异常处理",err)
// }
app.mount('#app')
